package com.java1412.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2024-01-11 16:05:00
 */
@RestController
public class HelloController {

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/hi")
    public String home() {
        System.out.println("hi is being called");
        return "hi i'm miya!";
    }

    @RequestMapping("/miya")
    public String info() {
        System.out.println("info is being called");
        return restTemplate.getForObject("http://localhost:8988/info", String.class);
    }
}
